package com.demo2do.fms.entity.supplier.common;

import org.apache.commons.lang3.StringUtils;

import com.demo2do.core.utils.Alias;

/**
 * 服务共方基本信息 公司规模
 * 
 * Created by zhonghui on 2017/7/11.
 */
@Alias("CompanySize")
public enum CompanySize {

    SIZE_TYPE_ZERO("01", ">10亿", "大于10千万"),

    SIZE_TYPE_ONE("02", "10-5亿", "5-10千万"),

    SIZE_TYPE_TWO("03", "5-2亿", "2-5千万"),

    SIZE_TYPE_THREE("04", "2-1亿", "1-2千万"),

    SIZE_TYPE_FOUR("05", "1亿-5千万", "0.5-1千万"),

    SIZE_TYPE_FIVE("06", "5-2千万", "0.2-0.5千万"),

    SIZE_TYPE_SIX("07", "<2千万", "小于0.2千万");

    private String code;
    
    private String transDescription;
    
    private String wareDescription;

    /**
     * @param code
     * @param transDescription
     * @param wareDescription
     */
    private CompanySize(String code ,String transDescription ,String wareDescription) {
        this.code = code;
        this.transDescription = transDescription;
        this.wareDescription = wareDescription;
    }
    
    /**
     * @param code
     * @return
     */
    public static CompanySize codeOf(String code) {
        
        for (CompanySize companySize : CompanySize.values()) {
            if (StringUtils.equals(companySize.getCode(), code)) {
                return companySize;
            }
        }
        
        return null;
        
    }

    /**
     * 
     * @return the code
     */
    public String getCode() {
        return code;
    }
   
    /**
     * 
     * @return
     */
    public String getTransDescription() {
        return transDescription;
    }
    
    /**
     * 
     * @return
     */
    public String getWareDescription() {
        return wareDescription;
    }
    
}
